<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>${describe}列表</title>
${r"<#"}include "/view/admin/headList.html"/>
    <script type="text/javascript">

        $(function() {
            //初始化
        });
    </script>
</head>
<body>



<div class="table-class">
    <div class="panel panel-default" style="margin: 10px 10px 10px;">
     <div class="panel-body">
        <form class="bs-example bs-example-form" role="form">
        <#list columnList as var>
            <#if 'text'==var.inputType>
            <div class="input-group">
                <span class="input-group-addon">${var.describe}</span>
                <input type="text" id="${var.properties}" class="form-control" value="${r"${"}entity.${var.properties}!${r"}"}" placeholder="请输入${var.describe}">
            </div>
                <span class="bank-label">&nbsp;</span>
            <#elseif 'date'==var.inputType>
                <div class="input-group">
                    <span class="input-group-addon">开始${var.describe}</span>
                    <input type="text" id="${var.properties}Start" class="form-control isdatetimepicker" value="${r"<#if "}(entity.${var.properties}Start)?? >${r"${"}entity.${var.properties}Start?string('yyyy-MM-dd HH:mm:ss')${r"}</#if>"}" id="${var.properties}Start" name="${var.properties}Start" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
                <div class="input-group">
                    <span class="input-group-addon">结束${var.describe}</span>
                    <input type="text" id="${var.properties}End" class="form-control isdatetimepicker" value="${r"<#if "}(entity.${var.properties}End)?? >${r"${"}entity.${var.properties}End?string('yyyy-MM-dd HH:mm:ss')${r"}</#if>"}" id="${var.properties}End" name="${var.properties}End" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
            <#elseif 'select'==var.inputType>
            <div class="input-group">
                <span class="input-group-addon">${var.describe}</span>
                <select id="${var.properties}" name="${var.properties}"
                <#if 'int'==var.inputCode||'str'==var.inputCode>
                        class="form-control selectpicker"   data-live-search="true"
                <#else>
                        class="form-control"
                </#if>
                >
                    <option value="">请选择${var.describe}</option>
                <#list listSelect as s>
                    <#if s.name==var.properties>
                        <#if 'int'==var.inputCode || 'str'==var.inputCode>
                            ${r"<#list"} list${var.propertiesUp} as lv>
                                <option value="${r"${"}lv.value!${r"}"}"
                                ${r"<#if"} entity.${var.properties}??&&entity.${var.properties} == lv.value >
                                    selected="selected"
                                ${r"</#if>"}
                                >${r"${"}lv.name!${r"}"}</option>
                            ${r"</#list>"}



                        <#else>
                            <#list s.select as st>
                                <option value="${st.value}" ${r"<#"}if entity.${var.properties}??&&${st.value} == entity.${var.properties}>selected="selected"${r"</#"}if>>${st.name}</option>

                            </#list>
                        </#if>

                    </#if>
                </#list>
                </select>

            </div>
                <span class="bank-label">&nbsp;</span>

            <#elseif 'switch'==var.inputType>
                <div class="input-group">
                    <span class="input-group-addon">${var.describe}</span>
                    <select id="${var.properties}" name="${var.properties}" class="form-control" >
                        <option value="">请选择${var.describe}</option>
                        <#list listSwitch as s>
                            <#if s.name==var.properties>
                                <#list s.switch as st>
                                    <option value="${st.value}" ${r"<#"}if entity.${var.properties}??&&${st.value} == entity.${var.properties}>selected="selected"${r"</#"}if>>${st.name}</option>
                                </#list>
                            </#if>
                        </#list>
                    </select>
                </div>
                <span class="bank-label">&nbsp;</span>
            </#if>

        </#list>

            <div class="input-group" style="text-align: right;">
                <a class="btn btn-info"  href="javascript:query('${r"${base}"}/${simpleClassname}/list.do')"><span class="glyphicon glyphicon-search"></span> 查找</a>

            </div>
        </form>
     </div>
    </div>


    <table class="table table-hover table-list">
        <thead>
        <tr>
            <td class="table-head-btn">
                <div style="text-align:left;margin-left: 50px;">
                    <a href="${r"${base}"}/${simpleClassname}/add.do" class="btn btn-primary">新增</a>
                </div>
            </td>
        </tr>
        <tr class="table-head">
            <th>序号</th>
        <#list columnList as var>
            <#if 'hidden'==var.inputType>
                <th class="label-hidden">${var.describe}</th>
            <#else>
                <th>${var.describe}</th>
            </#if>
        </#list>

            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        ${r"<#"}list pagination.list as c>
            <tr>
                <td>${r"${"}(pagination.pageNo-1)*pagination.pageSize+1+c_index${r"}"}</td>
                <#list columnList as var>
                    <#if 'hidden'==var.inputType>
                        <td class="label-hidden">${r"${"}c.${var.properties}!${r"}"}</td>
                    <#elseif 'date'==var.inputType>
                        <td>${r"<#"}if c.${var.properties}?? >${r"${"}c.${var.properties}?string('yyyy-MM-dd HH:mm:ss')${r"}</#"}if></td>
                    <#elseif 'file'==var.inputType>
                        <td><img src="${r"${base}"}${r"${"}c.${var.properties}!${r"}"}" height="50px"></td>
                    <#elseif 'switch'==var.inputType>
                    <td> <#list listSwitch as s>
                            <#if s.name==var.properties>
                            ${r"<#"}if c.${var.properties}??>
                                <#list s.switch as st>

                            <#if st.value==0>
                         ${r"<#"}if ${st.value}==c.${var.properties}><span class="label label-default">${st.name}</span>${r"</#"}if>
                            <#elseif st.value==1>
                         ${r"<#"}if ${st.value}==c.${var.properties}><span class="label label-success">${st.name}</span>${r"</#"}if>
                            </#if>
                                </#list>
                            ${r"</#"}if>
                            </#if>
                        </#list>
                    </td>
                    <#elseif 'select'==var.inputType>
                        <td> <#list listSelect as s>
                            <#if s.name==var.properties>
                            ${r"<#"}if c.${var.properties}??>
                                <#if 'int'==var.inputCode||'str'==var.inputCode>
                                    ${r"<#list"} list${var.propertiesUp} as lv>
                                        ${r"<#if"} lv.value??&&c.${var.properties} == lv.value >
                                        ${r"${"}lv.name!${r"}"}
                                        ${r"</#if>"}
                                    ${r"</#list>"}
                                <#elseif 'approvestatus'==var.inputCode>
                                    <#list s.select as st>
                                        <#if st.value==0>
                                        ${r"<#if"} 0==c.${var.properties}><span class="label label-default">${st.name}</span>
                                        <#elseif st.value==1>
                                        ${r"<#elseif"}   1==c.${var.properties}><span class="label label-success">${st.name}</span>
                                        <#elseif st.value==2>
                                        ${r"<#elseif"} 2==c.${var.properties}><span class="label label-danger">${st.name}</span>
                                        </#if>

                                    </#list>
                                    <#if s.select?size gt 0>
                                    ${r"</#if>"}
                                    </#if>
                                <#else>
                                    <#list s.select as st>
                                        <#if st_index==0>
                                        ${r"<#"}if c.${var.properties}==${st.value}>${st.name}
                                        <#else>
                                        ${r"<#"}elseif c.${var.properties}==${st.value}>${st.name}
                                        </#if>
                                        <#if (st_index+1)==s.select?size>
                                        ${r"</#if>"}
                                        </#if>
                                    </#list>
                                </#if>

                            ${r"</#if>"}
                            </#if>
                        </#list>
                        </td>
                    <#else>
                            <td>${r"${"}c.${var.properties}!${r"}"}</td>

                    </#if>
                </#list>

                <td>
                    <a href="${r"${base}"}/${simpleClassname}/detail.do?${keyProperties}=${r"${"}c.${keyProperties}!${r"}"}" class="btn btn-primary">详情</a>
                    <a href="${r"${base}"}/${simpleClassname}/add.do?${keyProperties}=${r"${"}c.${keyProperties}!${r"}"}" class="btn btn-primary">修改</a>
                    <a href="javascript:checkDelete('${r"${base}"}/${simpleClassname}/delete.do?${keyProperties}=${r"${"}c.${keyProperties}!${r"}"}')" class="btn btn-primary">删除</a>
                </td>
            </tr>








        ${r"</#list>"}
        </tbody>
    </table>


</div>
<script>

    function queryCondition(){
        var href="";
    <#list columnList as var>
        <#if 'text'==var.inputType||'switch'==var.inputType||'select'==var.inputType>
            href+='${var.properties}='+$('#${var.properties}').val()<#if columnList?size-1 != var_index></#if>;
                <#if (var_index+1)!=columnList?size>href+='&'</#if>
        <#elseif 'date'==var.inputType>
            href+='${var.properties}Start='+$('#${var.properties}Start').val()<#if columnList?size-1 != var_index>+"&"</#if>;
            href+='${var.properties}End='+$('#${var.properties}End').val()<#if columnList?size-1 != var_index></#if>;
                <#if (var_index+1)!=columnList?size>href+='&'</#if>
        </#if>
    </#list>
        return href;
    }

</script>

</body>
</html>
